program Summer;

{$APPTYPE CONSOLE}
type
summer = class
  n, sum : integer;
end;
SummerFast = class(summer)
  procedure summing;
end;
SummerSlow = class(summer)
  procedure summing;
end;
{ SummerFast }

procedure SummerFast.summing;
begin
  sum := n*(n-1)*0.5;
  writeln(sum);
end;

{ SummerSlow }

procedure SummerSlow.summing;
var
  i : integer;
begin
  for i:=1 to n do
    sum := sum+i;
  writeln(sum);
end;
var
  sf : summerFast;
  ss : summerSlow;
begin
  sf := summerFast.Create;
  ss := summerSlow.Create;
end.
 